# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Kevin Guan <KevinGuan.gm@gmail.com>

pkgname=iptux
pkgver=0.8.3
pkgrel=3
pkgdesc='LAN messenger and file sender, an IP Messenger client'
arch=('loong64' 'x86_64')
url='https://github.com/iptux-src/iptux/'
license=('GPL2')
depends=('google-glog' 'gtk3' 'jsoncpp' 'libsigc++')
makedepends=('appstream' 'gflags' 'meson')
checkdepends=('xorg-server-xvfb')
source=("https://github.com/iptux-src/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
         https://github.com/iptux-src/iptux/commit/2da09f26.patch)
sha256sums=('858fa04b987a0d576f6f67d5b5cbc543df01ed2b6c241ca890f93f89ebcb2331'
            'd2da91a77d5ba3762039905966b9f1dcc850bbbbf15cf5b56a4a98e53c3f8369')

prepare() {
  patch -d $pkgname-$pkgver -p1 < 2da09f26.patch # Fix build with meson 0.60
}

build() {
  arch-meson $pkgname-$pkgver build
  meson compile -C build
}

check() {
  xvfb-run meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
